﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Entity;

namespace Controller
{
    public partial class Controller_CheckIn : Component
    {
        Entity_CheckIn ent_CheckIn = new Entity_CheckIn();
        public Controller_CheckIn()
        {
            InitializeComponent();
        }

        public Controller_CheckIn(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        public DataSet Select_All_RoomStatus(int thang, int nam, string roomtypeID)
        {
            return ent_CheckIn._Select_All_RoomStatus(thang, nam, roomtypeID);
        }
        public bool Check_in(string id, string roomId, int slPhong, string Ngaydat, string ngayTra, int Nguoilon, int treEm, string maNV, string datTruoc, int maKH,string tongTien)
        {
            if (ent_CheckIn._Insert_Room_details(id, roomId, slPhong, Ngaydat, ngayTra, Nguoilon, treEm) == true)
                return ent_CheckIn._Insert_RentForm_Details(maNV, datTruoc, maKH, id, tongTien);
            return false;
        }
        public DataSet Select_CheckInInfo(string maKH)
        {
            return ent_CheckIn._Select_CheckInInfo(maKH);
        }

        public bool Update_CheckInInfo(string id, string checkInday, string checkOutday, int slPhong, int slNguoiLon, int slTreEm, string datCoc, string tongTien)
        {
            return ent_CheckIn._Update_CheckInInfo(id, checkInday, checkOutday, slPhong, slNguoiLon, slTreEm, datCoc, tongTien);
        }
    }
}
